<?php
session_start();
include "../php/config.php";
include "../php/paging.php";
if(empty($_SESSION["login.username"]))
	die("<meta http-equiv='refresh' content='0;URL=logout.php'>");
else
{
	$menu = $_GET["m"];
	if(empty($menu))
		$menu = "home";
	$submenu = $_GET["md"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<title>Media Marketindo - Administrator Page</title>
	<link href="../css/style.css" rel="stylesheet" type="text/css" />
	<script src="../js/clockp.js" type="text/javascript"></script>
	<script src="../js/clockh.js" type="text/javascript"></script> 
	<script src="../js/jquery.min.js" type="text/javascript"></script>
	<script src="../js/ddaccordion.js" type="text/javascript"></script>
	<script type="text/javascript">
	ddaccordion.init
	({
		animatedefault: false, //Should contents open by default be animated into view?
		animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
		collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
		contentclass: "submenu", //Shared CSS class name of contents group
		defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
		headerclass: "submenuheader", //Shared CSS class name of headers group
		mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
		onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
		oninit:function(headers, expandedindices)
		{	//custom code to run when headers have initalized
			//do nothing
		},
		onopenclose:function(header, index, state, isuseractivated)
		{	//custom code to run whenever a header is opened or closed
			//do nothing
		},
		persiststate: true, //persist state of opened contents within browser session?
		revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
		toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
		togglehtml: ["suffix", "<img class=\"statusicon\" src=\"../images/plus.gif\" />", "<img class=\"statusicon\" src=\"../images/minus.gif\" />"] //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	})
	</script>
	<script src="../js/jconfirmaction.jquery.js" type="text/javascript"></script>
	<script type="text/javascript">	
	$(document).ready(function()
	{
		$(".ask").jConfirmAction();
	});
	</script>
	<script language="javascript" type="text/javascript">
	var imagesPath = "../css/images/";
	</script>
	<script language="javascript" src="../js/niceforms.js" type="text/javascript"></script>
	<link href="../css/niceforms-default.css" media="all" rel="stylesheet" type="text/css" />
	<script language="javascript" type="text/javascript">
	$(function()
	{
		$("#form_search").submit(function()
		{
			var keyword = $("#keyword").val();
			if(!keyword)
				alert("Keyword masih kosong");	
			else
				return true;
			return false;
		});
	});
	</script>
	<script language="javascript" src="../js/jquery.validate.js" type="text/javascript"></script>
	<link href="../css/jquery_validation.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
	.hiding
	{
		display: none;
	}
	</style>
	<script language="javascript" type="text/javascript">
	function link_confirmation(message,href)
	{
		if(confirm(message))
			document.location.href = href;
	}
	</script>
	<script language="javascript" src="js/inc_<?php echo $menu; ?>.js" type="text/javascript"></script>
</head>
<body>
	<div id="main_container">
		<div class="header">
			<div class="logo"><br></div>
			<div class="right_header">
				Hai, <?php echo $_SESSION["login.name"]; ?> 
				| 
				<a class="logout" href="logout.php">Logout</a>
			</div>
			<div id="clock_a"></div>
		</div>
		<div class="main_content">
			<div class="menu">
				<ul>
					<li><a <?php if($menu == "home") echo "class=\"current\""; ?> href="?m=home">Home</a></li>
				</ul>
			</div>
			<div class="center_content">
				<div class="left_content">
					<div class="sidebar_search">
						<input class="search_input" id="keyword" name="keyword" type="text" value="search keyword" onclick="this.value=''" />
						<input class="search_submit" src="../images/search.png" type="image" />
					</div>
					<div class="sidebar_box">
						<div class="sidebar_box_top"></div>
						<div class="sidebar_box_content">
							<?php 
							if(!empty($submenu))
								$string_submenu = "_$submenu";
							@include "filters/$menu$string_submenu.php";
							?>
						</div>
						<div class="sidebar_box_bottom"></div>
					</div>
				</div>
				<div class="right_content">
					<?php 
					if(!empty($_SESSION["$menu.warning_msg"]))
					{
						echo "<div class=\"";
						if(!empty($_SESSION["$menu.warning_box"]))
							echo $_SESSION["$menu.warning_box"];
						else
							echo "warning";
						echo "_box\">".$_SESSION["$menu.warning_msg"]."</div>";
						unset($_SESSION["$menu.warning_msg"]);
						unset($_SESSION["$menu.warning_box"]);
					}
					@include "contents/$menu.php";
					?>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="footer"></div>
	</div>
</body>
</html>
<?php
}
?>